"""
A collection of molecules for testing and fun.

>>> h
Stoichiometry = H, Charge = 0, Multiplicity = 2
1 H     0.000000     0.000000     0.000000

"""

from pyquante2.geo.molecule import molecule,read_xyz_lines

h = molecule([(1,0,0,0)],name='Hydrogen')

h2 = molecule([(1,  0.00000000,     0.00000000,     0.36628549),
               (1,  0.00000000,     0.00000000,    -0.36628549)],
              units='Angstrom',
              name='Hydrogen')

h2o = molecule([(8,   0.00000000,     0.00000000,     0.04851804),
                (1,   0.75300223,     0.00000000,    -0.51923377),
                (1,  -0.75300223,     0.00000000,    -0.51923377)],
               units='Angstrom',
               name='Water')

oh = molecule([(8,  0.00000000,     0.00000000,    -0.08687037),
               (1,  0.00000000,     0.00000000,     0.86464814)],
              units='Angstrom',
              multiplicity=2,
              name='Hydroxide')
he = molecule(atomlist = [(2,0,0,0)],name='Helium')
he_triplet = molecule(atomlist = [(2,0,0,0)],name='Helium',multiplicity=3)
ne = molecule(atomlist = [(10,0,0,0)],name='Neon')
ar = molecule(atomlist = [(18,0,0,0)],name='Argon')
li = molecule(atomlist = [(3,0,0,0)], multiplicity=2,name='Lithium')
li_p = molecule(atomlist = [(3,0,0,0)],charge=1,name="Li+")
li_m = molecule(atomlist = [(3,0,0,0)],charge=-1,name="Li-")

lih = molecule([(3,    0.00000000,     0.00000000,    -0.53999756),
                (1,    0.00000000,     0.00000000,     1.08999756)],
               units='Angstrom',
               name="LiH")
             
co = molecule([(6,  0.00000000,     0.00000000,    -0.63546711),
               (8,  0.00000000,     0.00000000,     0.47832425)],
              units='Angstrom',
              name="CO")

ch4 = molecule([(6,   0.00000000,     0.00000000,     0.00000000),
                (1,   0.62558332,    -0.62558332,     0.62558332),
                (1,  -0.62558332,     0.62558332,     0.62558332),
                (1,   0.62558332,     0.62558332,    -0.62558332),
                (1,  -0.62558332,    -0.62558332,    -0.62558332)],
               units='Angstrom',
               name="CH4")

c6h6 = molecule([ (6,  0.98735329,     0.98735329,     0.00000000),
                  (6,  1.34874967,    -0.36139639,     0.00000000),
                  (6,  0.36139639,    -1.34874967,     0.00000000),
                  (6, -0.98735329,    -0.98735329,     0.00000000),
                  (6, -1.34874967,     0.36139639,     0.00000000),
                  (6, -0.36139639,     1.34874967,     0.00000000),
                  (1,  1.75551741,     1.75551741,     0.00000000),
                  (1,  2.39808138,    -0.64256397,     0.00000000),
                  (1,  0.64256397,    -2.39808138,     0.00000000),
                  (1, -1.75551741,    -1.75551741,     0.00000000),
                  (1, -2.39808138,     0.64256397,     0.00000000),
                  (1, -0.64256397,     2.39808138,     0.00000000)],
                units='Angstrom',
                name="Benzene")

# Tests of xyz reading; these are sample files moved over from the Vimes gallery
aspirin_dat = """\
C   -4.298178673   -2.680396318    3.255165577
C   -3.812718391   -4.011167049    3.370155334
C   -2.532230616   -4.366909981    2.919004679
C   -1.704535127   -3.397203684    2.340427637
C   -2.159109831   -2.075404167    2.214739084
C   -3.447553158   -1.695014238    2.663475990
O   -3.927595854   -0.417612791    2.559572458
C   -5.602114201   -2.386347532    3.730656862
O   -6.337605000   -3.257076263    4.252350330
O   -6.158821106   -1.154874086    3.662979841
C   -3.514747143    0.797332048    2.097138643
O   -4.354021549    1.716984868    2.228768349
C   -2.218879938    1.124873281    1.477183938
H   -4.386474609   -4.749268532    3.786830187
H   -2.203411579   -5.330899239    3.011837959
H   -0.770862103   -3.653458834    2.010648251
H   -1.526206732   -1.406248569    1.789622426
H   -7.064459801   -1.001233459    4.005530357
H   -2.168872356    2.181503534    1.204643130
H   -1.410930753    0.919331372    2.179908276
H   -2.084415674    0.535852194    0.569538891"""
aspirin = read_xyz_lines(aspirin_dat.splitlines(),name='Aspirin')

caffeine_dat = """\
H      -3.3804130    -1.1272367     0.5733036
N       0.9668296    -1.0737425    -0.8198227
C       0.0567293     0.8527195     0.3923156
N      -1.3751742    -1.0212243    -0.0570552
C      -1.2615018     0.2590713     0.5234135
C      -0.3068337    -1.6836331    -0.7169344
C       1.1394235     0.1874122    -0.2700900
N       0.5602627     2.0839095     0.8251589
O      -0.4926797    -2.8180554    -1.2094732
C      -2.6328073    -1.7303959    -0.0060953
O      -2.2301338     0.7988624     1.0899730
H       2.5496990     2.9734977     0.6229590
C       2.0527432    -1.7360887    -1.4931279
H      -2.4807715    -2.7269528     0.4882631
H      -3.0089039    -1.9025254    -1.0498023
H       2.9176101    -1.8481516    -0.7857866
H       2.3787863    -1.1211917    -2.3743655
H       1.7189877    -2.7489920    -1.8439205
C      -0.1518450     3.0970046     1.5348347
C       1.8934096     2.1181245     0.4193193
N       2.2861252     0.9968439    -0.2440298
H      -0.1687028     4.0436553     0.9301094
H       0.3535322     3.2979060     2.5177747
H      -1.2074498     2.7537592     1.7203047"""
caffeine = read_xyz_lines(caffeine_dat.splitlines(),name="Caffeine")

hmx_dat = """\
   N  0.5680149949  2.6293711200  0.3736776847
   C -0.6942751232  2.8705031073  1.0445507885
   N -1.7727589782  1.9871898655  0.6193546122
   C -1.7753610507  0.5758381283  0.9829852521
   N -0.7686377016 -0.2141474275  0.3017990192
   C  0.5471655431 -0.5099179346  0.8335910717
   N  1.5872193099  0.4135557216  0.3973826297
   C  1.6276589083  1.7853676267  0.8888065127
   N  0.7381267018  3.1768979200 -0.9093963072
   N  2.7980712477 -0.1447133899 -0.0780004587
   N -1.0509827475 -0.6385148606 -1.0078022155
   N -3.0166173612  2.5818173406  0.2989156708
   O -0.1874526445  3.8560459604 -1.3342654849
   O  1.7984454108  2.9274206178 -1.4679403488
   O  3.7351175454  0.6256837894 -0.2394361072
   O  2.8051031691 -1.3502696381 -0.2877089067
   O -0.1689562567 -1.2724500643 -1.5724155800
   O -2.1536504460 -0.3400471272 -1.4475363780
   O -3.9667134006  1.8259041193  0.1461329863
   O -3.0364422016  3.8014821835  0.2019531460
   H  2.5926214029  2.1968423404  0.6040800504
   H  1.5260977918  1.7963201594  1.9807757865
   H -0.5021178750  2.7386376784  2.1162145458
   H -1.0219335717  3.8887489905  0.8511352897
   H -1.5781151260  0.4647032481  2.0560705202
   H -2.7633740401  0.1883945774  0.7479214905
   H  0.4507923100 -0.4781294376  1.9256045749
   H  0.8527197221 -1.5046000931  0.5192138085"""
hmx = read_xyz_lines(hmx_dat.splitlines(),name="HMX")

petn_dat = """\
   C  0.1410793535  0.4581345076  0.2201593117
   C  0.8740604879  1.6157987302 -0.3141501772
   C -1.1626471896  0.9222034433  0.8600505241
   C -0.2117341605 -0.6894313453 -1.2453784520
   C  0.9896521176 -0.2240187463  1.2056623040
   O  1.7439184315  2.3415010522 -0.0250996160
   O  1.9314411397 -0.9093884276  1.1910028069
   O -1.1673425240 -0.3379105694 -1.8099952515
   O -2.1005406819  0.2160068466  1.2252607161
   N  0.8834232566  3.0815049912 -2.0175504108
   N  2.0344406898 -1.0871188474  3.4210556734
   N -1.5503392516 -1.5668351132 -3.7360231846
   N -2.4198991066  2.5348866847  1.5706440447
   O  0.6609804245  3.6981103247 -3.0227795413
   O  0.1061766502  2.0499863939 -1.7938626682
   O  2.8686616701 -1.5612804866  4.1571695219
   O  1.0842175679 -0.3697510262  3.6851867996
   O -1.9078630102 -0.9117476405 -4.6655603017
   O -1.1067939800 -2.6688759860 -3.6166286008
   O -2.5743247911  3.6561803864  1.7376540608
   O -1.2125337042  2.2041767152  0.8590609937"""
petn = read_xyz_lines(petn_dat.splitlines(),name="PETN")

prozac_dat = """\
C      -4.204150677    2.072559834    2.445252657
C      -2.956681728    2.471860170    1.931164742
C      -2.653449297    2.291296959    0.572549760
C      -3.625182629    1.746667147   -0.287973195
C      -4.875847340    1.350180984    0.219326869
C      -5.183345318    1.488867998    1.599147558
C      -6.507333279    1.021624088    2.112216711
F      -7.504102230    1.751085401    1.513242602
F      -6.655373573    1.145838857    3.475257158
F      -6.680150032   -0.305047899    1.795951247
O      -1.397952557    2.633965254    0.185220689
C      -0.693459392    2.383789539   -1.039916396
C       0.703698575    3.047793865   -0.873532474
C      1.440563560    2.695808887    0.450122446
N       2.573244095    3.616067886    0.715876579
C      3.793125868    3.382066011   -0.093926162
C     -0.621079624    0.923271060   -1.380522609
C     -0.321022570   -0.050377049   -0.396260649
C     -0.243787885   -1.417304993   -0.722696662
C     -0.487607300   -1.839488983   -2.041245222
C     -0.822565317   -0.893800497   -3.026665211
C     -0.882454753    0.475452125   -2.699392080
H     -4.392243862    2.204611063    3.444783926
H      -2.252326488    2.883808136    2.546307564
H      -3.421798944    1.632374644   -1.280278921
H      -5.569090843    0.946386993   -0.421400517
H      -1.221978307    2.923262358   -1.835593104
H       1.335648417    2.778292179   -1.723436952
H       0.573392689    4.133985996   -0.908729315
H       0.731759250    2.764698267    1.288701773
H       1.798444033    1.662662983    0.427404791
H      2.263438463    4.593839169    0.605822384
H      4.585585594    4.052670479    0.245289013
H      4.155097961    2.357360125    0.025952235
H      3.614778280    3.575026989   -1.153746247
H     -0.168022826    0.229777738    0.574449360
H     -0.022803972   -2.102428675    0.004875974
H     -0.427532613   -2.834338427   -2.281645775
H     -1.025909305   -1.204776525   -3.980842352
H     -1.123792887    1.146540284   -3.432668924"""
prozac = read_xyz_lines(prozac_dat.splitlines(),name="Prozac")

rdx_dat = """\
   N  0.6718881059  0.0182651659  1.1639927098
   C -0.7217853677 -0.4040877654  1.2497480146
   N -1.3435536737  0.0196369732  0.0000000000
   C -0.7217853677 -0.4040877654 -1.2497480146
   N  0.6718881059  0.0182651659 -1.1639927098
   C  1.4437523125 -0.4033435474  0.0000000000
   N  1.3699718436  0.0968888811  2.3737152810
   N  1.3699718436  0.0968888811 -2.3737152810
   N -2.7401403285  0.1015901229  0.0000000000
   O  0.6922265936  0.1417103939  3.3943989304
   O  2.5927603597  0.1423786550  2.2972834368
   O  2.5927603597  0.1423786550 -2.2972834368
   O  0.6922265936  0.1417103939 -3.3943989304
   O -3.2851031443  0.1480879984 -1.0972264092
   O -3.2851031443  0.1480879984  1.0972264092
   H -0.8028142165 -1.4961047851 -1.3888481204
   H -1.2010991605  0.1025912411 -2.0806078091
   H  2.4020047488  0.1051303064  0.0000000000
   H  1.6069882485 -1.4950329010  0.0000000000
   H -0.8028142165 -1.4961047851  1.3888481204
   H -1.2010991605  0.1025912411  2.0806078091"""
rdx = read_xyz_lines(rdx_dat.splitlines(),name="RDX")

taxol_dat="""\
C    2.5071   -0.9379    0.6914
C    3.3433   -0.1915   -0.3266
C    2.4181    0.2295   -1.5086
C    1.0962    0.9745   -1.6817
C   -0.0190    0.5661   -0.6136
C   -0.4612   -0.9983   -0.5840
C    0.1983   -1.9596    0.5429
C    1.7475   -2.2948    0.4068
C    2.1661   -0.4021    1.9248
C    1.0945   -0.9692    2.8335
C   -0.1441   -1.4815    1.9835
O   -0.4358   -3.1868    0.3487
C   -1.2850    1.5467   -0.4760
C   -0.9831    3.0582   -0.7856
C    0.2286    3.4339   -1.6709
C    1.4329    2.4880   -1.4984
C   -2.4362    1.6596   -1.5483
O   -2.2793    3.1281   -1.4906
C    0.6583    0.6880   -3.1285
H    0.4044    0.7888    0.3088
O   -1.8978    1.2857    0.7652
C    2.7463    0.9227    2.3637
O    0.5833   -0.0471    3.8189
O    4.4383   -1.0468   -0.5999
O    2.4152    2.9573   -2.4405
O   -1.8009   -1.1778   -0.5162
O    2.9982   -0.1765   -2.5533
C    2.1061   -2.8996   -1.0108
C    2.3118   -3.4247    1.4075
C   -2.7791    1.7328    1.6238
C   -3.4972    2.9971    1.3517
O   -2.9727    1.0732    2.6482
C    5.6341   -0.8292   -1.1583
C    6.0072    0.5367   -1.6430
O    6.4058   -1.7754   -1.2671
C   -2.9021   -1.5750   -1.0885
C   -3.9422   -1.3482   -0.1355
O   -3.1894   -2.0174   -2.1874
C   -5.2078   -0.8965   -0.6244
C   -3.8643   -1.5829    1.2313
C   -4.9284   -1.3740    2.0905
C   -6.1386   -0.9131    1.5909
C   -6.2745   -0.6779    0.2302
H    3.7595    0.7668   -0.0558
H   -0.2249   -1.4478   -1.5263
H    1.5584   -1.7412    3.4566
H   -0.9472   -0.7375    2.0352
H   -0.5513   -2.2978    2.6278
H   -1.3848   -3.1657    0.4755
H   -0.9446    3.6181    0.1481
H   -0.0777    3.4589   -2.7255
H    0.5622    4.4536   -1.4379
H    1.8305    2.6787   -0.4996
H   -2.3665    1.2309   -2.5316
H   -3.4541    1.3958   -1.1819
H    0.5199   -0.3491   -3.4333
H   -0.2779    1.1959   -3.4046
H    1.3302    1.1156   -3.9173
H    2.6048    1.2507    3.3799
H    2.4173    1.7061    1.6793
H    3.8547    0.8382    2.2874
H   -0.1247   -0.4368    4.3237
H    2.6910    3.8517   -2.2664
H    1.5479   -3.8603   -1.1486
H    3.1577   -3.1548   -1.1489
H    1.8248   -2.3755   -1.9110
H    3.1475   -3.1233    2.0608
H    1.5343   -3.7387    2.1450
H    2.6407   -4.4088    1.0401
H   -2.8614    3.8769    1.4874
H   -4.3045    3.1231    2.1159
H   -4.0146    3.0583    0.4007
H    5.3422    0.8761   -2.4361
H    5.9704    1.2525   -0.8163
H    7.0314    0.5392   -2.0374
H   -5.3359   -0.7098   -1.6817
H   -2.9363   -1.9653    1.6271
H   -4.8263   -1.5744    3.1478
H   -6.9749   -0.7523    2.2571
H   -7.2205   -0.3311   -0.1599"""
taxol = read_xyz_lines(taxol_dat.splitlines(),name="Taxol")

tylenol_dat = """\
O      -1.713616610    1.243716955    0.736445725
C      -1.341511130   -0.054340221    0.820427537
C      -2.036442518   -0.939841688    1.663589954
C      -1.641770601   -2.287945032    1.748548269
C      -0.544515491   -2.774863720    1.001593471
C       0.134313673   -1.874176383    0.142606720
C      -0.257164538   -0.524646401    0.058567956
N      -0.249021173   -4.093309879    1.156122208
C       0.898427188   -4.765147686    0.888041556
O       1.944948316   -4.211537838    0.476741612
C       0.919175148   -6.218533993    1.125376105
H      -2.469556570    1.577612042    1.263748765
H      -2.829293728   -0.605991662    2.216500759
H      -2.163447142   -2.913754463    2.368732214
H       0.908987880   -2.185167789   -0.443058282
H       0.246597588    0.113255978   -0.562205553
H      -0.959591031   -4.633766651    1.537439585
H       0.701575160   -6.423584938    2.174993753
H       0.163852051   -6.703066826    0.504316807
H       1.894107819   -6.647564888    0.883226514"""
tylenol = read_xyz_lines(tylenol_dat.splitlines(),name="Tylenol")

viagara_dat = """\
N   -3.4932   -1.8950    0.1795
C   -4.9343   -1.8728    0.3721
C   -5.6426   -2.7318   -0.6885
N   -5.3188   -2.2766   -2.0316
C   -3.8765   -2.2967   -2.2211
C   -3.1722   -1.4332   -1.1621
C   -5.9989   -3.0732   -3.0409
S   -2.6047   -1.0544    1.4320
O   -3.0459   -1.5296    2.7325
O   -2.7462    0.3736    1.2100
C   -0.8416   -1.5089    1.2833
C   -0.4767   -2.8190    0.9782
C    0.8715   -3.1614    0.8754
C    1.9131   -2.2421    1.0805
C    1.5323   -0.9266    1.4362
C    0.1717   -0.5774    1.5074
O    3.2423   -2.5637    0.9627
C    3.6560   -3.9129    0.8537
C    3.4986   -4.6530    2.1797
C    2.5235    0.1311    1.7434
N    2.2058    1.3693    1.5634
C    3.1680    2.3366    1.8683
C    4.4210    2.0152    2.3622
C    4.7754    0.6071    2.5864
N    3.7377   -0.1996    2.2334
C    3.1548    3.7431    1.7561
N    4.3088    4.2528    2.1585
N    5.0756    3.1970    2.5271
O    5.8231    0.1644    3.0251
C    6.4497    3.1956    3.0384
C    2.0453    4.6124    1.2469
C    2.2634    5.0072   -0.2216
C    2.3003    3.7945   -1.1618
H   -5.3179   -0.8255    0.3205
H   -5.1951   -2.2780    1.3797
H   -6.7457   -2.6675   -0.5272
H   -5.3465   -3.8003   -0.5585
H   -3.6265   -1.9006   -3.2348
H   -3.4900   -3.3425   -2.1646
H   -2.0700   -1.4889   -1.3350
H   -3.4800   -0.3682   -1.2952
H   -5.6926   -4.1433   -2.9939
H   -7.1030   -3.0134   -2.9049
H   -5.7743   -2.6837   -4.0602
H   -1.2477   -3.5878    0.8055
H    1.0806   -4.2065    0.6026
H   -0.1229    0.4452    1.7917
H    4.7423   -3.8845    0.5977
H    3.1524   -4.4131   -0.0009
H    3.9032   -5.6884    2.1012
H    2.4370   -4.7379    2.5003
H    4.0543   -4.1341    2.9945
H    3.8553   -1.1874    2.3725
H    6.8154    4.2456    3.0903
H    7.1030    2.6172    2.3471
H    6.4649    2.7540    4.0602
H    1.9820    5.5268    1.8830
H    1.0758    4.0730    1.3558
H    3.2162    5.5811   -0.3186
H    1.4381    5.6884   -0.5419
H    2.4010    4.1167   -2.2238
H    1.3671    3.1920   -1.0766
H    3.1625    3.1270   -0.9362"""
viagara = read_xyz_lines(viagara_dat.splitlines(),name="Viagara")

zoloft_dat="""\
C    -3.4189    1.6783    0.2712
C    -2.3505    0.8226    0.1761
C    -2.5442   -0.5245   -0.0609
C    -3.8482   -0.9387   -0.2141
C    -4.9116   -0.0942   -0.1254
C    -4.6942    1.2285    0.1219
C    -1.2442   -1.5065   -0.1780
C     0.1001   -0.8180    0.1643
C     0.1088    0.6161   -0.3864
C    -0.9880    1.4363    0.3382
C    -1.1794   -3.1240   -0.0741
C     0.0593   -3.7230   -0.0484
C     0.1854   -5.0912    0.0054
C    -0.9272   -5.8861    0.0353
C    -2.1646   -5.3177    0.0190
C    -2.2694   -3.9627   -0.0362
N    -1.0649    2.8593   -0.0684
Cl    1.7268   -5.8255    0.0273
Cl   -0.7832   -7.5945    0.0883
C     0.1920    3.5855    0.2026
H    -3.2576    2.6483    0.4532
H    -4.0221   -1.9059   -0.3993
H    -5.8427   -0.4405   -0.2403
H    -5.4646    1.8621    0.1928
H    -1.5413   -1.6355   -1.1241
H     0.2159   -0.7923    1.1573
H     0.8513   -1.3351   -0.2460
H     1.0030    1.0332   -0.2232
H    -0.0777    0.5999   -1.3687
H    -0.7055    1.4107    1.2971
H     0.8812   -3.1539   -0.0691
H    -2.9850   -5.8888    0.0471
H    -3.1830   -3.5563   -0.0499
H    -1.2910    2.9239   -1.0725
H     0.0961    4.5381   -0.0860
H     0.9405    3.1579   -0.3043
H     0.3918    3.5529    1.1819"""
zoloft = read_xyz_lines(zoloft_dat.splitlines(),name="Zoloft")




if __name__ == '__main__':
    import doctest
    doctest.testmod()

